<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
	<script src="{yun:}$config.sy_weburl{/yun}/js/jquery-1.8.0.min.js?v={yun:}$config.cachecode{/yun}"></script>
	<script src="js/admin_public.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
	<link href="{yun:}$config.sy_weburl{/yun}/js/layui/css/layui.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet">
	<link href="images/reset.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css" />
	<link href="images/system.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css" />
	<link href="images/table_form.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css" />
	<title>后台管理</title>
</head>

<body class="body_ifm">

<div id="info_div"  style="display:none;  ">
	 <form class="layui-form" action="index.php?m=crm_salesman_list&c=status" target="supportiframe" method="post" id="formstatus">
		<table cellspacing='1' cellpadding='1' class="admin_examine_table">
			<tr>
				<th width="80">任职状态：</th>
				<td align="left">
					<div class="layui-form-item">
						<div class="layui-input-block">
							<input name="status" id="state1" value="1" title="在职" type="radio"/>
							<input name="status" id="state2" value="2" title="离职" type="radio"/>
						</div>
					</div>
				</td>
			</tr>
			<tr>
				<td colspan='2' align="center">
					<input type="submit"  value='确认' class="admin_examine_bth">
					<input type="button" id="zxxCancelBtn" onClick="layer.closeAll();" class="admin_examine_bth_qx" value='取消'>
				</td>
			</tr>
			
		</table>
		<input type="hidden" name="pytoken" value="{yun:}$pytoken{/yun}" />
		<input name="uid" value="0" type="hidden" />
	</form>
</div>

<div class="infoboxp">
	
	<div class="admin_new_tip">
		<a href="javascript:;" class="admin_new_tip_close"></a>
		<a href="javascript:;" class="admin_new_tip_open" style="display:none;"></a>
		<div class="admin_new_tit"><i class="admin_new_tit_icon"></i>操作提示</div>
		<div class="admin_new_tip_list_cont">
			<div class="admin_new_tip_list">该页面展示了CRM业务员 。</div>
			<div class="admin_new_tip_list">业务员设为离职后，该账号无法再登录后台。已分配待跟进的客户，重置为未分配状态。</div>
		</div>
	</div>

	<div class="admin_new_search_box">
		<form action="index.php" name="myform" method="get"> 
			<input name="m" value="crm_salesman_list" type="hidden"/>
  			<div class="admin_new_search_name">搜索类型：</div>
			
			<div class="admin_Filter_text formselect" did='dkeytype'>
				<input type="button" {yun:}if $get_type.keytype==''||$get_type.keytype=='1'{/yun} value="用户名"  {yun:}elseif $get_type.keytype=='2'{/yun} value="业务员姓名"  {yun:}elseif $get_type.keytype=='3'{/yun} value="业务员ID" {yun:}/if{/yun} class="admin_Filter_but" id="bkeytype">
			
				<input type="hidden" name="type" id="keytype" {yun:}if $get_type.keytype==''||$get_type.keytype=='1'{/yun} value="1"  {yun:}elseif $get_type.keytype=='2'{/yun} value="2" {yun:}elseif $get_type.keytype=='3'{/yun} value="3" {yun:}/if{/yun}/>
			
				<div class="admin_Filter_text_box" style="display:none" id="dkeytype">
					<ul> 
						<li><a href="javascript:void(0)" onClick="formselect('1','keytype','用户名')">用户名</a></li>
						<li><a href="javascript:void(0)" onClick="formselect('2','keytype','业务员姓名')">业务员姓名</a></li>
						<li><a href="javascript:void(0)" onClick="formselect('3','keytype','业务员ID')">业务员ID</a></li>
					</ul>
				</div>
			</div>

			<input type="text" value="" placeholder="请输入你要搜索的关键字" name='keyword'class="admin_new_text">
			<input type="submit" value="搜索" name='search'  class="admin_new_bth">
			<a href="index.php?m=admin_user&c=add" class="admin_new_cz_tj">+ 添加业务员</a> 
		</form>
	</div>  

	<div class="clear"></div>  
	
	<div class="table-list">
		<div class="admin_table_border">
			<iframe id="supportiframe"  name="supportiframe" onload="returnmessage('supportiframe');" style="display:none"></iframe>
			<form action="index.php"  target="supportiframe" name="myform" method="get" id='myform'>
				<input name="m" value="crm_salesman_list" type="hidden"/>
				<table width="100%">
					<thead>
						<tr class="admin_table_top">
							<th align="center" style="width:5%;">
								<label for="chkall">
									<input type="checkbox" id='chkAll'  onclick='CheckAll(this.form)'/>
								</label>
							</th>
							<th align="center" style="width:5%;"> 
								{yun:}if $smarty.get.t=="uid" && $smarty.get.order=="asc"{/yun} 
									<a href="index.php?m=crm_salesman_list&order=desc&t=uid">用户ID<img src="images/sanj.jpg"/></a> 
								{yun:}else{/yun} 
									<a href="index.php?m=crm_salesman_list&order=asc&t=uid">用户ID<img src="images/sanj2.jpg"/></a> 
								{yun:}/if{/yun}
							</th>

							<th align="left">姓名/用户名</th>
							<th align="left">待跟进客户</th>
							<th align="left">已跟进客户</th>
							<th align="left">待回访客户</th>
							<th align="left">签单数</th>
							<th align="left">签单金额</th>
							<th align="left">所属部门</th>
							<th align="left">在职/离职</th>
 							<th class="admin_table_th_bg" >操作</th>
						</tr>
					</thead>
					<tbody>
						{yun:}foreach item=v key=key from=$userrows{/yun}
						<tr {yun:}if ($key+1)%2=='0'{/yun}class="admin_com_td_bg"{yun:}/if{/yun} id="list{yun:}$v.uid{/yun}">
							<td align="center" width="5%;">
								<input type="checkbox" value="{yun:}$v.uid{/yun}" class="check_all"  name='del[]' onclick='unselectall()' rel="del_chk" style="margin-left:5px;"/>
							</td>
							<td align="center" style="width:5%;" class="td1">{yun:}$v.uid{/yun}</td>
							<td align="left">{yun:}$v.name{/yun} / {yun:}$v.username{/yun}</td>
							<td align="left">{yun:}$v.concernNum{/yun}</td>
							<td align="left">{yun:}$v.concernedNum{/yun}</td>
							<td align="left">{yun:}$v.returnVisitNum{/yun}</td>
							<td align="left">{yun:}$v.orderNum{/yun}</td>
							<td align="left">{yun:}$v.orderPrice{/yun}</td>
							<td align="left">{yun:}if $v.depart{/yun}{yun:}$crmClassName[$v.depart]{/yun}{yun:}else{/yun} -- {yun:}/if{/yun}</td>
							<td align="left">{yun:}if $v.status == 1{/yun}在职{yun:}else{/yun}离职{yun:}/if{/yun}</td>
							<td width="210">
								<a href="index.php?m=admin_user&c=add&uid={yun:}$v.uid{/yun}" class="crm_cz" >修改信息</a>
								<a href="javascript:void(0);" class="crm_cz check" pid="{yun:}$v.uid{/yun}" status="{yun:}$v.status{/yun}" >离职设置</a>
								<a class="crm_cz" {yun:}if $v.cnum gt 0 {/yun} href="index.php?m=crm_salesman_list&c=customer_list&auid={yun:}$v.uid{/yun}" {yun:}else{/yun} href="javascript:void(0);" onclick="layer.msg('暂无分配客户');" {yun:}/if{/yun}> 客户列表</a>
								<a href="index.php?m=crm_salesman_list&c=assign_company&uid={yun:}$v.uid{/yun}" class="crm_cz " pid="{yun:}$v.uid{/yun}" status="{yun:}$v.status{/yun}" );" >分配客户</a>
								<a class="crm_cz" {yun:}if $v.concernNum gt 0{/yun} href="index.php?m=crm_salesman_list&c=shift_company&uid={yun:}$v.uid{/yun}"  {yun:}else{/yun}  href="javascript:void(0);" onclick="layer.msg('没有可转移客户');" {yun:}/if{/yun} >转移客户</a>
								<a class="crm_cz" {yun:}if $v.concernedNum gt 0{/yun} href="index.php?m=crm_concernall&uid={yun:}$v.uid{/yun}" {yun:}else{/yun} href="javascript:void(0);" onclick="layer.msg('暂无跟进记录',2,8);" {yun:}/if{/yun}>跟进记录</a>
							</td>
						</tr>
						{yun:}/foreach{/yun}
						<tr>
							<td align="center"><input type="checkbox" id='chkAll2' onclick='CheckAll2(this.form)' /></td>
							<td colspan="9" ><label for="chkAll2">全选</label></td>
						</tr>
						{yun:}if $total > $config.sy_listnum {/yun}
							<tr>
								{yun:}if $pagenum==1{/yun}
									<td colspan="3"> 从 1 到 {yun:}$config.sy_listnum {/yun} ，总共 {yun:}$total{/yun} 条</td>
								{yun:}else if $pagenum > 1 && $pagenum < $pages{/yun}
									<td colspan="3"> 从 {yun:}($pagenum-1) * $config.sy_listnum + 1{/yun} 到 {yun:}$pagenum * $config.sy_listnum{/yun} ，总共 {yun:}$total{/yun} 条</td>
								{yun:}else if $pagenum == $pages{/yun}
									<td colspan="3"> 从 {yun:}($pagenum-1) * $config.sy_listnum + 1{/yun} 到 {yun:}$total{/yun} ，总共 {yun:}$total{/yun} 条</td>
								{yun:}/if{/yun}
								<td colspan="8" class="digg">{yun:}$pagenav{/yun}</td>
							</tr>
						{yun:}/if{/yun}
					</tbody>
				</table>
				<input type="hidden" name="pytoken" id='pytoken' value="{yun:}$pytoken{/yun}">
			</form>
		</div>
	</div>
</div>

<script src="{yun:}$config.sy_weburl{/yun}/js/layui/layui.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
<script src="{yun:}$config.sy_weburl{/yun}/js/layui/phpyun_layer.js?v={yun:}$config.cachecode{/yun}"></script>

<script>

	layui.use([ 'layer', 'form' ], function() {
		var layer = layui.layer, 
			form = layui.form, 
			$ = layui.$;
	});
	
	$(function() {

		$(".check").click(function() {
	
			$("input[name=pid]").val($(this).attr("pid"));
			var uid 	= $(this).attr("pid");
			var status 	= $(this).attr("status");
			$("#state" + status).attr("checked", true);

			layui.use([ 'form' ], function() {
				var form = layui.form;
				form.render();
			});
			
			$("input[name=uid]").val(uid);
			$.get("index.php?m=user_member&c=lockinfo&uid=" + uid, function(msg) {
				$("#alertcontent").val($.trim(msg));
				$.layer({
					type : 1,
					title : '离职设置',
					closeBtn : [ 0, true ],
					border : [ 10, 0.3, '#000', true ],
					area : [ 'auto', '180px' ],
					page : {
						dom : "#info_div"
					}
				});
			});
		});
	});

	
</script>
</body>
</html>
